function make_debug (debug_tmp_var,debug_tmp_name,nfocus){
	if(typeof(oDebugData)=='undefined') oDebugData=new Object();
	if(typeof(debug_window)=='undefined'){						
			debug_width=(screen.availWidth/3);
			debug_height=(screen.availHeight-60);
			debug_window=window.open('','debug','alwaysLowered=1, directories=0, height='+debug_height+', width='+debug_width+', hotkeys=0, location=0, menubar=0, resizable=1, scrollbars=1 ,status=1 ,titlebar=0,toolbar=0, screenX='+(screen.availWidth-debug_width-10)+', left='+(screen.availWidth-debug_width-10)+', screenY=0, top=0');
			debug_window.document.write('<pre>');
	}
	temp_name=String(debug_tmp_name);	
	if(temp_name.length==0) {
		temp_name=Number(0);
		for(i in oDebugData) temp_name++;
	}	
	oDebugData[temp_name]=debug_tmp_var;	
	temp_out=new String('<html><head><title>DEBUG</title><script language="javascript1.4" type="text/javascript" src="_tvs_system_core_/js/debug.js"></script></head><body style="margin:0 5px 0 5px; padding:0 5px 0 5px">');	
	temp_end=new String('</body></html>');	
	for(i in oDebugData) temp_out+='<div style="font-family:Verdana; font-size:11px; cursor:pointer" onClick="toggle_debug(document.getElementById(\''+i+'\'))"><hr><b>'+i+'</b><br></div><span id="'+i+'" style="font-size:11px; visibility:hidden; position:absolute"><pre>'+oDebugData[i]+'</pre></span><hr>';	
	debug_window.document.open();
	debug_window.document.write(temp_out+temp_end);
	debug_window.document.close();
	if(nfocus==1) debug_window.focus();
}
function toggle_debug (oToggle){	
	if(oToggle.style.visibility!='hidden'){
		oToggle.style.visibility='hidden';
		oToggle.style.position='absolute';
	}else {
		oToggle.style.visibility='visible';
		oToggle.style.position='relative';
	}
}